package com.example.patternfactory0307.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

public class HljTest {

    public static void main(String[] args) {
        testAtomicLong();
    }

    private static void testAtomicLong(){

        AtomicLong counter = new AtomicLong();

        int flag = 0;

        while (true){
            List<User> users = new ArrayList<>();
            for (int i = 0 ; i < 10;i++){
                users.add(new User((long) i,"name" + i,"password" + i));
            }
            counter.addAndGet(users.size());

            if (flag >= 3){
                break;
            }
            flag++;
        }

        System.out.println("  ===  " + counter.get());
    }
}
